#include "JetPlane.h"
#include "ObjectLoader.h"

extern M3DVector4f vLightEyePos;

JetPlane::JetPlane(GLShaderManager* shaderManager,
		GLGeometryTransform& transformPipeline, GLTriangleBatch triangles) :
		ThreeDObject(shaderManager, transformPipeline) {
	this->planeBatch = triangles;
	fillPlaneColor();
	fillBatch();
}
void JetPlane::apearOnScreen() {
	this->shaderManager->UseStockShader(GLT_SHADER_POINT_LIGHT_DIFF,
			transformPipeline.GetModelViewMatrix(),
			transformPipeline.GetProjectionMatrix(), vLightEyePos, vPlaneColor);
	planeBatch.Draw();
}
void JetPlane::fillBatch() {
	ObjectLoader obj("fullF16.obj");
	obj.loadObject(&planeBatch);
}

void JetPlane::fillPlaneColor() {
	vPlaneColor[0] = 1.0f;
	vPlaneColor[1] = 0.0f;
	vPlaneColor[2] = 1.0f;
	vPlaneColor[3] = 1.0f;
}
